home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Magazine / SoundLab / Studio16add / sources / S16IsStudio.asm < prev    next >
Encoding:
Assembly Source File  |  1997-12-10  |  3.4 KB  |  164 lines

  1. *>b:S16IsStudio
  2.  
  3.     *«««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««*
  4.     *   Copyright © 1997 by Kenneth "Kenny" Nilsen.  E-Mail: kenny@bgnett.no              *
  5.     *   Source viewed in 800x600 with mallx.font (11) in CED                      *
  6.     *»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
  7.     *
  8.     *   Name
  9.     *    S16IsStudio
  10.     *
  11.     *   Function
  12.     *    Check if a valid studio 16 file
  13.     *
  14.     *   Inputs
  15.     *    <file>
  16.     *
  17.     *   Notes
  18.     *    
  19.     *   Bugs
  20.     *    
  21.     *   Created    : 11.11.97
  22.     *   Changes    : 11.11.97, 26.11.97
  23.     *««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««*
  24.  
  25.  
  26. ;StartSkip    SET    1
  27. ;DODUMP        SET    1
  28.  
  29.  
  30.         Incdir    ""
  31.  
  32.         include    lvo:exec_lib.i
  33.         include    lvo:dos_lib.i
  34.  
  35.         Incdir    inc:
  36.  
  37.         include    digital.macs
  38.         include    digital.i
  39.         include    dos/dos.i
  40.         include    libraries/studio16file.i
  41.  
  42.         include    startup.asm
  43.  
  44.         Incdir    ""
  45.  
  46.         dc.b    "$VER: S16IsStudio 1.1 (26.11.97)",10
  47.         dc.b    "Copyright © 1997 Digital Surface. All rights reserved. ",0
  48.         even
  49. *»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
  50. Init        DefLib    dos,37
  51.         DefEnd
  52.  
  53. Start    LibBase    dos
  54.  
  55.     NextArg
  56.     beq    About
  57.     move.l    d0,a0
  58.     cmp.b    #'?',(a0)
  59.     beq    About
  60.  
  61.     lea    FileN(pc),a1
  62. .copy    move.b    (a0)+,(a1)+
  63.     bne.b    .copy
  64.  
  65. ;copy filepart to own buffer
  66.  
  67.     lea    FileN+300(pc),a0
  68.     move.l    #300,d0
  69. .findDr    move.b    (a0),d1
  70.     cmp.b    #'/',d1
  71.     beq    .ok
  72.     cmp.b    #':',d1
  73.     beq    .ok
  74.     lea    -1(a0),a0
  75.     subq    #1,d0
  76.     bne    .findDr
  77.     lea    -1(a0),a0
  78.  
  79. .ok    lea    1(a0),a0
  80.     lea    Buffer(pc),a1
  81. .copyN    move.b    (a0)+,(a1)+
  82.     bne.b    .copyN
  83.  
  84.     move.l    #FileN,d1
  85.     move.l    #MODE_OLDFILE,d2
  86.     Call    Open
  87.     move.l    d0,Handler
  88.     beq    ErrorOpen
  89.  
  90.     move.l    d0,d1
  91.     move.l    #Buff,d2
  92.     moveq    #4,d3
  93.     Call    Read
  94.     cmp.l    #4,d0
  95.     bne    ErrorRead
  96.  
  97.     move.l    Buff(pc),d0
  98.     cmp.l    #'KWK3',d0
  99.     bne    Errortype
  100.  
  101. *------------------------------------------------------------------------------------------------------------*
  102. Close    move.l    Handler(pc),d1
  103.     beq    .noHan
  104.     Call    Close
  105.  
  106. .noHan    move.l    Warn(pc),d0
  107.     rts
  108. *»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
  109. Proc    move.b    d0,(a3)+
  110.     rts
  111.  
  112. ErrorType    LibBase    exec
  113.         lea    TypeTxt(pc),a0
  114.         lea    Table(pc),a1
  115.         lea    Proc(pc),a2
  116.         lea    FileN(pc),a3
  117.         Call    rawDoFmt
  118.         LibBase    dos
  119.         move.l    #5,Warn
  120.         move.l    #FileN,d1
  121.         bra    Print
  122.  
  123. ErrorOpen    LibBase    exec
  124.         lea    ErrOpen(pc),a0
  125.         lea    Table(pc),a1
  126.         lea    Proc(pc),a2
  127.         lea    FileN(pc),a3
  128.         Call    rawDoFmt
  129.         LibBase    dos
  130.         move.l    #FileN,d1
  131.         move.l    #5,Warn
  132.         bra    Print
  133.  
  134. ErrorRead    move.l    #ErrRead,d1
  135.         move.l    #5,Warn
  136.         bra    Print
  137.  
  138. ErrorSeek    move.l    #ErrSeek,d1
  139.         move.l    #5,Warn
  140.         bra    Print
  141.  
  142. About        move.l    #AboutTxt,d1
  143.  
  144. Print        Call    PutStr
  145.         bra    Close
  146. *»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
  147. FileN        dcb.b    300,0
  148. Buffer        dcb.b    30,0
  149. Handler        dc.l    0
  150. Buff        dc.l    0
  151. Table        dc.l    Buffer
  152. Warn        dc.l    0
  153. *»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
  154. ErrOpen        dc.b    "Couldn't open file '%s'!",10,0
  155. ErrRead        dc.b    "Error reading file!",10,0
  156. ErrSeek        dc.b    "Error seeking file!",10,0
  157. ErrType        dc.b    "Not a Studio 16 (3.0) file!",10,0
  158.  
  159. TypeTxt        dc.b    "File '%s' is not a Studio 16 file (3.0)!",10,0
  160.  
  161. AboutTxt    dc.b    10,"S16IsStudio 1.1 by Kenneth 'Kenny' Nilsen (kenny@bgnett.no)",10,10
  162.         dc.b    "    USAGE: S16IsStudio <file>",10,10,0
  163. *»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
  164.